package com.ccit.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ccit.model.Admin;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AdminMapper extends BaseMapper<Admin> {
    //根据email查询该管理员是否存在
    @Select("SELECT * from `administrator` WHERE deleted=0 AND (email=#{email})")
    List<Admin> isExist(@Param("email") String email);


    //根据email查找管理员信息
    @Select("SELECT * from administrator WHERE deleted = 0 AND (email = #{email})")
    Admin selectAdminByEmail(@Param("email") String email);

}
